package cn.dnui_xcz826.dnuifood_16110100826.model;

import cn.dnui_xcz826.dnuifood_16110100826.iface.FoodIface;
import cn.dnui_xcz826.dnuifood_16110100826.listener.onRetrofitListener;
import cn.dnui_xcz826.dnuifood_16110100826.service.FoodService;
import retrofit2.Call;

/**
 * Created by Administrator on 2018/11/5.
 */

public class FoodModel extends BaseModel implements FoodIface {
    private FoodService service;
    public FoodModel(){
        //super();
        service=retrofit.create(FoodService.class);
    }


    @Override
    public void getFoodById(String food_id, onRetrofitListener listener) {
        Call call=service.doGetFoodById(food_id);
        bindCallback(call,listener,6);
    }

    @Override
    public void getFoodBySearch(String search, onRetrofitListener listener) {
        Call call=service.doGetFoodBySearch(search);
        bindCallback(call,listener,7);
    }
}
